import request from "./request";

export default {
  // 获取学生列表
  getStudents() {
    return request({
      url: "/students",
      method: "get",
    });
  },

  // 获取单个学生信息
  getStudent(id) {
    return request({
      url: `/students/${id}`,
      method: "get",
    });
  },

  // 创建学生
  createStudent(data) {
    return request({
      url: "/students",
      method: "post",
      data,
    });
  },

  // 更新学生信息
  updateStudent(id, data) {
    return request({
      url: `/students/${id}`,
      method: "put",
      data,
    });
  },

  // 删除学生
  deleteStudent(id) {
    return request({
      url: `/students/${id}`,
      method: "delete",
    });
  },
};
